import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getwidget/components/avatar/gf_avatar.dart';
import 'package:getwidget/components/image/gf_image_overlay.dart';
import 'package:getwidget/components/list_tile/gf_list_tile.dart';

import '../controllers/gftile_controller.dart';

class GftileView extends GetView<GftileController> {
  String avatarPath = "assets/images/cliu.jpg";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('瓦片'),
        centerTitle: true,
      ),
      body: Container(
        margin: EdgeInsets.all(10),
        child: ListView(
          children: [
            GFListTile(
              titleText:'初六',
              subTitleText:'https://space.bilibili.com/1601108355',
              icon: Icon(Icons.favorite, color: Colors.red)
            ),

            GFListTile(
              avatar: GFAvatar(
                backgroundImage: AssetImage(avatarPath),
              ),
              titleText:'初六',
              subTitleText:'https://space.bilibili.com/1601108355',
              icon: Icon(Icons.favorite, color: Colors.red)
            ),

            GFListTile(
              avatar: GFAvatar(
                backgroundImage: AssetImage(avatarPath),
              ),
              titleText:'初六',
              subTitleText:'https://space.bilibili.com/1601108355',
              description: Text('Lorem ipsum dolor sit amet, consectetur adipiscing'),
              icon: Icon(Icons.favorite, color: Colors.red),
              color: Colors.lightGreen.shade200,
            ),
            Divider(),

            GFListTile(
              avatar: GFImageOverlay(
                image: AssetImage(avatarPath),
                width: 60,
                height: 60,
              ),
              titleText:'初六',
              subTitleText:'懂二进制的男人',
              icon: Icon(Icons.favorite, color: Colors.red),
              enabled: true,
              onTap: () {
                Get.snackbar('提示', 'Works');
              },
            ),
            GFListTile(
              avatar: GFImageOverlay(
                image: AssetImage('assets/images/flutter.jpg'),
                width: 60,
                height: 60,
              ),
              titleText:'Flutter',
              subTitleText:'跨端开发框架',
              icon: Icon(Icons.favorite, color: Colors.red),
              enabled: false,
              onTap: () {
                Get.snackbar('提示', 'Works');
              },
            ),
          ],
        ),
      ),
    );
  }
}
